<template>
	<view class="uni_box home">
		<navbar backColor="#fff" backgroundColor="#fc772c">
		</navbar>
		<view class="content" v-if="identity == 1">
			<image class="img_qzz" src="/static/img/img_qzz.png" />
			<text class="qname">你当前是求职者身份</text>
			<view class="qiebtn"  @click="getqie(2)">切换老板身份</view>
			<view class="qiebtn zanbu" @click="getback">暂不切换</view>
		</view>
		<view class="content" v-if="identity == 2">
			<image class="img_qzz" src="/static/img/img_lb.png" />
			<text class="qname">你当前是老板身份</text>
			<view class="qiebtn"  @click="getqie(1)">切换求职者身份</view>
			<view class="qiebtn zanbu"  @click="getback">暂不切换</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				status:2,//老板 2员工
				identity:''
			}
		},
		onLoad(option) {
			if(option.identity){
				this.identity = option.identity
			}
		},
		onShow() {
		},
		methods: {
			getback(){
				uni.navigateBack({ delta: 1 })
			},
			async getqie(e){
				let identity = e
				let res = await this.$u.api.setNowIdentity({
					identity:identity
				});
				

				if(e == 1){
					uni.setStorageSync('wenxinpop',null)//设置老板端 默认进入弹出
					uni.setStorageSync('identity',1);//1用户
					this.$store.commit('changeidentity',1);
					uni.switchTab({ url: '/pages/tabbar/ClientHome',animationType:'slide-in-right' })
				}else if(e == 2){
					uni.setStorageSync('wenxinpop',null)//设置老板端 默认进入弹出
					uni.setStorageSync('identity',2);//2老板
					this.$store.commit('changeidentity',2);
					uni.switchTab({ url: '/pages/tabbar/ClientHome',animationType:'slide-in-right' })
				}
			}

		}
	}
</script>

<style lang="scss" scoped>
	page{
		background-color: #fc772c;
	}
	.content{
		background-color: #fc772c;
		height: 100vh;
		display: flex;
		flex-direction: column;
		// margin: 0 30rpx;
		padding: 0 30rpx 270rpx;
		align-items: center;
		justify-content: center;
		// padding-bottom: 170rpx;
		.img_qzz{
			width: 138rpx;
			height: 138rpx;
			margin-bottom: 40rpx;
		}
		.qname{
			font-weight: bold;
			font-size: 40rpx;
			color: #FFFFFF;
			display: block;
			margin-bottom: 70rpx;
		}
		.qiebtn{
			width: 100%;
			height: 100rpx;
			background: #FFFFFF;
			border-radius: 30rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			font-weight: 800;
			font-size: 35rpx;
			color: #111111;
			margin-bottom: 40rpx;
		}
		.zanbu{
			background: rgba(255, 255, 255, 0.2);
			color: rgba(255, 255, 255, 1);
		}
	}
</style>
